package net.jwtools.tmt.domain;

import java.io.Serializable;


/**
 * This is an object that contains data related to the PERSON table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="PERSON"
 */

public abstract class BasePerson  implements Serializable {

	public static String REF = "Person";
	public static String PROP_STATUS = "status";
	public static String PROP_SUR_NAME = "surName";
	public static String PROP_GENDER = "gender";
	public static String PROP_FIRST_NAME = "firstName";
	public static String PROP_ID = "id";
	public static String PROP_SUR_NAME_PREFIX = "surNamePrefix";


	// constructors
	public BasePerson () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BasePerson (java.lang.Long id) {
		this.setId(id);
		initialize();
	}

	/**
	 * Constructor for required fields
	 */
	public BasePerson (
		java.lang.Long id,
		java.lang.String firstName,
		java.lang.String surNamePrefix,
		java.lang.String surName) {

		this.setId(id);
		this.setFirstName(firstName);
		this.setSurNamePrefix(surNamePrefix);
		this.setSurName(surName);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Long id;

	// fields
	private java.lang.String firstName;
	private java.lang.String surNamePrefix;
	private java.lang.String surName;
	private net.jwtools.tmt.domain.Gender gender;
	private net.jwtools.tmt.domain.Status status;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="increment"
     *  column="ID"
     */
	public java.lang.Long getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setId (java.lang.Long id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: FIRSTNAME
	 */
	public java.lang.String getFirstName () {
		return firstName;
	}

	/**
	 * Set the value related to the column: FIRSTNAME
	 * @param firstName the FIRSTNAME value
	 */
	public void setFirstName (java.lang.String firstName) {
		this.firstName = firstName;
	}



	/**
	 * Return the value associated with the column: SURNAME_PREFIX
	 */
	public java.lang.String getSurNamePrefix () {
		return surNamePrefix;
	}

	/**
	 * Set the value related to the column: SURNAME_PREFIX
	 * @param surNamePrefix the SURNAME_PREFIX value
	 */
	public void setSurNamePrefix (java.lang.String surNamePrefix) {
		this.surNamePrefix = surNamePrefix;
	}



	/**
	 * Return the value associated with the column: SURNAME
	 */
	public java.lang.String getSurName () {
		return surName;
	}

	/**
	 * Set the value related to the column: SURNAME
	 * @param surName the SURNAME value
	 */
	public void setSurName (java.lang.String surName) {
		this.surName = surName;
	}



	/**
	 * Return the value associated with the column: gender
	 */
	public net.jwtools.tmt.domain.Gender getGender () {
		return gender;
	}

	/**
	 * Set the value related to the column: gender
	 * @param gender the gender value
	 */
	public void setGender (net.jwtools.tmt.domain.Gender gender) {
		this.gender = gender;
	}



	/**
	 * Return the value associated with the column: status
	 */
	public net.jwtools.tmt.domain.Status getStatus () {
		return status;
	}

	/**
	 * Set the value related to the column: status
	 * @param status the status value
	 */
	public void setStatus (net.jwtools.tmt.domain.Status status) {
		this.status = status;
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof net.jwtools.tmt.domain.Person)) return false;
		else {
			net.jwtools.tmt.domain.Person person = (net.jwtools.tmt.domain.Person) obj;
			if (null == this.getId() || null == person.getId()) return false;
			else return (this.getId().equals(person.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}